﻿using System;
using System.Collections.Generic;
using System.Text;

namespace iFinity.PropertyAgent.ModuleFriendlyUrlProvider.Entities
{
    internal class FriendlyUrlInfo
    {
        public int itemId;
        public int parentId;
        public string itemType;
        public string urlFragment;
        public DateTime urlDate;
        public int urlNum;
        internal string FUrlPrefix
        {
            get
            {
                return GetPrefixForType(itemType);
            }
        }
        internal string FUrlKey
        {
            get
            {
                string prefix = this.FUrlPrefix;
                return prefix + itemId.ToString();
            }
        }
        internal static string GetPrefixForType(string itemType)
        {
            string prefix = "";
            switch (itemType.ToLower())
            {
                case "property":
                    prefix = "i";
                    break;
                case "propertytype":
                    prefix = "t";
                    break;

            }
            return prefix;
        }
        internal static string GetPrefixWithId(string itemType, int id)
        {
            return GetPrefixForType(itemType) + id.ToString();
        }
    }
    internal class FriendlyUrlInfoCol : List<FriendlyUrlInfo>
    {
    }
}
